package com.feicheng.house.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.feicheng.house.entity.Yuanshipingzhengbiao;
import com.feicheng.house.result.ResultInfo;
import com.feicheng.house.service.IYuanshipingzhengbiaoService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-11-06
 */
@RestController
@RequestMapping("/house/yuanshipingzhengbiao")
public class YuanshipingzhengbiaoController {

	@Autowired
	private IYuanshipingzhengbiaoService yuanshipingzhengbiaoService;

	/**
	 * 查询原始凭证基本信息 	  分页查询
	 * @param currentPage 每页多少条
	 * @param pageSize    当前页
	 * @param searchKey    模糊查询条件
	 * @return 原始凭证基本信息集合
	 */
	@GetMapping("/page")
	public ResultInfo selectYuanshipingzheng(Integer currentPage, Integer pageSize,String searchKey) {
		return yuanshipingzhengbiaoService.selectYuanshipingzhengbiao(currentPage,pageSize,searchKey);
	}
	
	/**
     * 新增原始凭证基本信息
     * @param yuanshipingzhengbiao 原始凭证对象
     * @return    原始凭证新增结果
     */
	@PostMapping("/insert")
	public ResultInfo addYuanshipingzhengbiao(Yuanshipingzhengbiao yuanshipingzhengbiao) {
		return yuanshipingzhengbiaoService.addYuanshipingzhengbiao(yuanshipingzhengbiao);
	}
}

